#include <Servo.h>

Servo myservo;

int pos = 0;
const int Pin = 4;//触摸正极
const int DJ_Pin = 9;//舵机正极

void setup() {
  // put your setup code here, to run once:
  myservo.attach(9);
  pinMode(Pin, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:

  if (digitalRead(Pin) == HIGH) {
    myservo.write(150);
    delay(5000);
    myservo.write(0);
  }
}
